import Singleton from '../Base/Singleton'
import { ITile } from '../Levels'
import { PlayerManager } from '../Scripts/Player/PlayerManager'
import { TileManager } from '../Scripts/Tile/TileManager'
import { WoodenSkeletonManager } from '../Scripts/WoodenSkeleton/WoodenSkeletonManager'

/*
* 数据中心,数据单例
*/
export default class DataManager extends Singleton{
  // override
  static get Instance() {
    return super.GetInstance<DataManager>()
  }
  // 地图信息
  mapInfo: Array<Array<ITile>>
  // 方块可走性信息
  tileInfo: Array<Array<TileManager>>
  mapRowCount: number = 0
  mapColumnCount: number = 0

  // player数据
  player:PlayerManager

  // 敌人数据
  enemis:Array<WoodenSkeletonManager>
  // 关卡
  levelIndex: number = 1

  reset() {
    this.mapInfo = []
    this.tileInfo = []
    this.mapRowCount = 0
    this.player = null
    this.enemis = []
    this.mapColumnCount = 0
  }
}
